<template>
  <div class="recommend">
      <p class="title">热门推荐</p>
      <div class="list">
        <div class="list-img" v-for="item of list" :key="item.id">
            <router-link :to="'/detail/'+item.id">
              <img :src="item.imgUrl"/>
            </router-link>
        </div>
      </div>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  } // list 是父组件通过属性传过来带有数据的
}
</script>

<style lang="stylus" scoped>
@import '~styles/varibles.styl'
.recommend
  .title
    color $mainColor
    background #f9f9f9
    padding  .2rem
    font-weight bold
  .list
    width 100%
    column-count 2
    column-gap 0
    column-fill:auto
    column-width:50%
    .list-img
      border:1px solid #fff
    img
      width 100%
</style>
